package com.t9;

import java.util.Arrays;

/**
 * Created by xuyiwei on 2018/7/20.
 */
class E11Base  {
    public String process(String str) {
        char[] arr = str.toCharArray();
        int size = arr.length;
        char[] arrChange = new char[size];
        for (int i = size - 1; i >= 0; i--) {
            int t = size - 1 - i;
            arrChange[t] = arr[i];
        }
        return String.valueOf(arrChange );
    }
}

class Adpter implements Processor11{
    private E11Base e11Base;

    public Adpter(E11Base e11Base) {
        this.e11Base = e11Base;
    }


    @Override
    public String name() {
        return getClass().getSimpleName();
    }

    @Override
    public Object process(Object input) {
        return e11Base.process((String)input);
    }
}


public class E11 {
    public static void process(Processor11 p ,Object s){
        System.out.println("Using Processor "+p.name());
        System.out.println(p.process(s));
    }

    public static void main(String[] args) {
        E11.process(new Adpter(new E11Base()),"AAVADW");
    }
}
